FROM maven:3-jdk-8-alpine

RUN mkdir /workspace
WORKDIR /workspace

# ADD 会自动解压，解压完成会删除tar.gz包，COPY后再RUN不会删除（原因是每一个命令都是新一层，不能再删除）
ADD target/ews-server-3.2.1.0.0-exec.tar.gz .
#COPY target/ews-server-3.2.1.0.0-exec.tar.gz .
#RUN tar -xvzf ews-server-3.2.1.0.0-exec.tar.gz && rm -rf ews-server-3.2.1.0.0-exec.tar.gz

ENV PORT 10013
EXPOSE $PORT

#HEALTHCHECK --interval=60s --timeout=5s --retries=3 CMD curl http://localhost:$PORT/sso/actuator/health

#ENTRYPOINT
CMD [ "sh", "-c", "/workspace/ews-server-3.2.1.0.0/bin/docker_startup.sh"]
